import request from '@/utils/request'
//根据微信手机号code绑定手机号
export function bindWinXinMobile(data) {
	return request({
		url: '/member/user/update-mobile-by-weixin',
		method: 'PUT',
		data: data
	})
}
//修改用户基本信息
export function alterUserInfo(data) {
	return request({
		url: '/member/user/update',
		method: 'PUT',
		data: data
	})
}
//判断申请业务员的相关逻辑
export function salse() {
	return request({
		url: '/beer/system-business/get',
		method: 'GET',
	})
}
// 申请成为业务员
export function applySales() {
	return request({
		url: '/beer/system-business/apply',
		method: 'POST',
	})
}

//获得商品分类
export function categoryList() {
	return request({
		url: '/beer/product-category/list',
		method: 'GET',
	})
}

//获得商品列表
export function getGoodsList(data) {
	return request({
		url: '/beer/product-goods/list',
		method: 'GET',
		data: data
	})
}

//获得商品详情
export function getGoodsDetails(data) {
	return request({
		url: '/beer/product-goods/get',
		method: 'GET',
		data: data
	})
}
//客户申请成为商户状态
export function applyMerchantsType() {
	return request({
		url: '/beer/system-customer/customer-get',
		method: 'GET',
	})
}
//客户申请成为商户
export function applyMerchants() {
	return request({
		url: '/beer/system-customer/customer-apply',
		method: 'POST',
	})
}

//商户独自发起商户申请表单
export function customerApply(data) {
	return request({
		url: '/beer/system-customer/customer-submit',
		method: 'POST',
		data: data
	})
}
//业务员发起商户申请表单
export function businessApply(data) {
	return request({
		url: '/beer/system-customer/business-submit',
		method: 'POST',
		data: data
	})
}
//获得区县数据
export function areaTree() {
	return request({
		url: '/system/area/tree-guizhou',
		method: 'GET',
	})
}
//添加商品进购物车
export function addGoodsInCat(data) {
	return request({
		url: '/beer/cart/add',
		method: 'POST',
		data: data
	})
}

//获取购物车列表
export function getCartList(data) {
	return request({
		url: '/beer/cart/list?customerId=' + data.customerId + '&type=' + data.type,
		method: 'GET',
	})
}

//更新购物车选中状态
export function changeSele(data) {
	return request({
		url: '/beer/cart/update-selected',
		method: 'PUT',
		data: data
	})
}

//更新购物车商品数量
export function changeNumber(data) {
	return request({
		url: '/beer/cart/update-count',
		method: 'PUT',
		data: data
	})
}

//删除购物车
export function del(data) {
	return request({
		url: '/beer/cart/delete?ids=' + data,
		method: 'DELETE',
	})
}

//创建订单
export function createOrder(data) {
	return request({
		url: '/beer/order/create',
		method: 'POST',
		data: data
	})
}

//提交订单
export function paySubmit(data) {
	return request({
		url: '/pay/order/submit',
		method: 'POST',
		data: data
	})
}

//获得订单分页
export function getOrderList(data) {
	return request({
		url: '/beer/order/page',
		method: 'GET',
		data
	})
}

//获得订单详情
export function getDetails(data) {
	return request({
		url: '/beer/order/get-detail?id=' + data.id + '&sync=' + data.sync,
		method: 'GET',
	})
}

//获得退款订单详情
export function getReduceDetails(data) {
	return request({
		url: '/beer/after-sale/get',
		method: 'GET',
		data
	})
}

//发起售后申请
export function afterSale(data) {
	return request({
		url: '/beer/after-sale/create',
		method: 'POST',
		data: data
	})
}

//商家同意售后
export function agreeSale(data) {
	return request({
		url: '/beer/after-sale/agree?id=' + data.id,
		method: 'PUT',
	})
}
//商家拒绝售后
export function disagreeSale(data) {
	return request({
		url: '/beer/after-sale/disagree?id=' + data.id,
		method: 'PUT',
	})
}
//商家同意售后退款
export function refundSale(data) {
	return request({
		url: '/beer/after-sale/refund?id=' + data.id,
		method: 'PUT',
	})
}
//取消售后
export function cancelSale(data) {
	return request({
		url: '/beer/after-sale/cancel?id=' + data.id,
		method: 'DELETE',
	})
}

//获得个人中心订单数量1/补货订单数量2
export function getCount(data) {
	return request({
		url: '/beer/order/get-count',
		method: 'GET',
		data
	})
}

//获得默认收货地址
export function getAddress() {
	return request({
		url: '/member/address/get-default',
		method: 'GET',
	})
}

//取消订单
export function cancelOrder(data) {
	return request({
		url: '/beer/order/cancel?id=' + data.id,
		method: 'DELETE',
	})
}

//删除订单
export function deleteOrder(data) {
	return request({
		url: '/beer/order/delete?id=' + data.id,
		method: 'DELETE',
	})
}

//收货/取酒
export function receive(data) {
	return request({
		url: '/beer/order/receive?id=' + data.id,
		method: 'PUT',
	})
}

//获得退款订单
export function refundPage(data) {
	return request({
		url: '/beer/after-sale/page',
		method: 'GET',
		data
	})
}